<template>
  <div class="pad_10">
    <el-form ref="queryRef" :inline="true" label-width="68px">
      <el-form-item>
        <el-button @click="handleQuery">新增</el-button>
        <el-button @click="handleQuery">保存</el-button>
      </el-form-item>
    </el-form>
    <el-divider />
    <SetUserSelect
      ref="setUserSelect"
      class="queryForm"
      :labelwidth="100"
      :isShowUserBtn="false"
      :buttonIsShow="false"
      :formData="bill"
      :queryParams="datas"
      @selChangeFun="changeFun"
      :key="keys"
    ></SetUserSelect>
  </div>
</template>
<script setup lang="ts">
import { addHospital } from "@/api/basicManagement/hospital";
import { watch, getCurrentInstance, ref } from "vue";
import data from "./data";
const { bill, datas } = data;
let keys = ref<number>(0);
const { proxy } = getCurrentInstance();
let proxys: any = proxy;
const { new_hospital_level } = proxys.useDict("new_hospital_level");
watch(
  new_hospital_level,
  (newV, oldV) => {
    bill.value[1].selectData = new_hospital_level.value;
    keys.value = new Date().getTime();
  },
  {
    // deep: false, // 深层次监听
    // immediate: true, // watch 第一次直接触发 (默认watch第一次不触发的)
  }
);

const { b, c }: { b: number; c: string } = {
  b: 12,
  c: "12",
};
interface Ggtype {
  a: number;
  b: string;
}
const gg = <Ggtype>{
  a: 1,
  b: "12",
};
const handleQuery = function (): void {};
const changeFun = function (e: any): void {
  console.log(e);
};
function initData() {
  addHospital().then((res) => {});
}
// initData()
// class Person<T>{
//   // public 定义类的变量默认就是公共的，继承的子类可以通过this来访问
//   // private 定义类的私有属性，只能在内部访问
//   // protected: 在类的内部和子类中可以访问,在外面就访问不到了
//   private _value: T;
//   constructor(val: T) {
//       this._value = val;
//   }
// }
// let p = new Person<string>('fa')
// console.log('pd1', p)

// 接口定义泛型
// interface types {
//   label: string;
// }
// const p = ref<types>({
//   label: '3421'
// })

// 类定义泛型
// type types = string
// const p = ref<types>('1')
</script>
<style scoped>
.pad_10 {
  padding: 10px;
}
.pad_10 .el-form--inline .el-form-item {
  margin: 0;
}
.el-divider--horizontal {
  margin: 10px 0;
}
</style>